package cn.bigfire.wzdj.util;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import io.github.dahuoyzs.JProtoc;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;


/**
 * 所有协议接口查询
 * <a href="https://wzdj.hnys68.cn:20002/get_rpc_cfg?_v=7edba38366ce905f128a00668f5bf763&code=plain">json 和 protobuf</a>
 * https://wzdj.hnys68.cn:20002/get_rpc_cfg?_v=7edba38366ce905f128a00668f5bf763&code=plain
 *
 * 更新流程
 * 1运行 updateProtoFile 方法。
 * 2.同时把新增的协议号。添加到idMap里。
 * 3.然后再运行testShowReceiveCode。
 * 4.把新增的协议号接收代码贴近caller里就行了
 */
@Slf4j
public class IdMaps {

    public static HashMap<Integer, String> idTypeMap = new HashMap<>();
    public static HashMap<String, Integer> typeIdMap = new HashMap<>();

    static {
        idTypeMap.put(655361, "RpcClientUserToken");
        idTypeMap.put(655362, "RpcClientCloseReason");
        idTypeMap.put(655363, "RpcServerLogin");
        idTypeMap.put(655364, "RpcClientLoginFinish");
        idTypeMap.put(655365, "RpcServerBackHome");
        idTypeMap.put(655366, "RpcClientBackHome");
        idTypeMap.put(655367, "RpcClientRoleCreate");
        idTypeMap.put(655368, "RpcClientTellmeI18n");
        idTypeMap.put(655369, "RpcClientUserProp");
        idTypeMap.put(655370, "RpcServerUserIsNew");
        idTypeMap.put(655371, "RpcServerUserRename");
        idTypeMap.put(655372, "RpcClientUserRename");
        idTypeMap.put(655373, "RpcServerUserReserve");
        idTypeMap.put(655374, "RpcClientUserReserve");
        idTypeMap.put(655375, "RpcServerUserClientError");
        idTypeMap.put(655376, "RpcServerUserView");
        idTypeMap.put(655377, "RpcClientUserView");
        idTypeMap.put(655378, "RpcServerUserActivationCode");
        idTypeMap.put(655379, "RpcClientEnterScene");
        idTypeMap.put(655380, "RpcClientUserLv");
        idTypeMap.put(655381, "RpcServerUserChangeAvatar");
        idTypeMap.put(655382, "RpcClientUserChangeAvatar");
        idTypeMap.put(655383, "RpcServerUserAvatarList");
        idTypeMap.put(655384, "RpcClientUserAvatarList");
        idTypeMap.put(655385, "RpcClientUserAvatarAdd");
        idTypeMap.put(655386, "RpcServerUserChangeFrame");
        idTypeMap.put(655387, "RpcClientUserChangeFrame");
        idTypeMap.put(655388, "RpcServerUserFrameList");
        idTypeMap.put(655389, "RpcClientUserFrameList");
        idTypeMap.put(655390, "RpcClientUserFrameAdd");
        idTypeMap.put(655391, "RpcServerUserNewbieGuide");
        idTypeMap.put(655392, "RpcClientUserNewbieGuide");
        idTypeMap.put(655393, "RpcServerUserModuleGuide");
        idTypeMap.put(655394, "RpcClientUserModuleGuide");
        idTypeMap.put(655395, "RpcServerUserSetAvatarNameByAuth");
        idTypeMap.put(655396, "RpcClientFighterSkinList");
        idTypeMap.put(655397, "RpcServerClearPvpRecord");
        idTypeMap.put(720897, "RpcClientMailAdd");
        idTypeMap.put(720898, "RpcServerMailList");
        idTypeMap.put(720899, "RpcClientMailList");
        idTypeMap.put(720900, "RpcServerMailRead");
        idTypeMap.put(720901, "RpcClientMailRead");
        idTypeMap.put(720902, "RpcServerMailReceive");
        idTypeMap.put(720903, "RpcClientMailReceive");
        idTypeMap.put(720904, "RpcServerMailOneKeyReceive");
        idTypeMap.put(720905, "RpcClientMailOneKeyReceive");
        idTypeMap.put(720906, "RpcServerMailDelete");
        idTypeMap.put(720907, "RpcClientMailDelete");
        idTypeMap.put(720908, "RpcServerMailOneKeyDelete");
        idTypeMap.put(720909, "RpcClientMailOneKeyDelete");
        idTypeMap.put(786433, "RpcClientItemList");
        idTypeMap.put(786434, "RpcClientItemOne");
        idTypeMap.put(786435, "RpcServerItemUse");
//        idTypeMap.put(786436, "RpcServerItemManySelectOne");//2024-11-12 移除
        idTypeMap.put(786437, "RpcClientCommonRewardAdd");
        idTypeMap.put(786438, "RpcClientEnergy");
        idTypeMap.put(851969, "RpcServerPayCreateOrder");
        idTypeMap.put(851970, "RpcClientPayCreateOrder");
        idTypeMap.put(917505, "RpcServerNoticeList");
        idTypeMap.put(917506, "RpcClientNoticeList");
        idTypeMap.put(917507, "RpcServerNoticeRead");
        idTypeMap.put(917508, "RpcClientNoticeRead");
        idTypeMap.put(917509, "RpcClientNoticeNew");
        idTypeMap.put(917510, "RpcClientNoticeDelete");
        idTypeMap.put(917511, "RpcServerNoticeQqNum");
        idTypeMap.put(917512, "RpcClientNoticeQqNum");
        idTypeMap.put(983041, "RpcClientTipsInfo");
        idTypeMap.put(983042, "RpcClientLoginTipsInfo");
        idTypeMap.put(1048577, "RpcServerCmd");
        idTypeMap.put(1048578, "RpcClientCmd");
        idTypeMap.put(1114113, "RpcServerShopInfoAll");
        idTypeMap.put(1114114, "RpcClientShopInfoAll");
        idTypeMap.put(1114115, "RpcServerShopInfoOne");
        idTypeMap.put(1114116, "RpcClientShopInfoOne");
        idTypeMap.put(1114117, "RpcServerShopBuy");
        idTypeMap.put(1114119, "RpcClientShopDel");
        idTypeMap.put(1114120, "RpcServerShopReadRed");
        idTypeMap.put(1114121, "RpcClientShopMultiDiamondInfo");
        idTypeMap.put(1114122, "RpcServerShopRefresh");
        idTypeMap.put(1179649, "RpcClientMissionList");
        idTypeMap.put(1179650, "RpcClientMissionUpdate");
        idTypeMap.put(1179652, "RpcClientMissionDelete");
        idTypeMap.put(1179653, "RpcServerMissionComplete");
        idTypeMap.put(1179655, "RpcServerMissionRefresh");
        idTypeMap.put(1179656, "RpcClientMissionRefreshState");
        idTypeMap.put(1179657, "RpcServerDailyMissionPointReward");
        idTypeMap.put(1179658, "RpcClientDailyMissionPointReward");
        idTypeMap.put(1179659, "RpcClientDailyMissionPointSync");
        idTypeMap.put(1179660, "RpcServerMissionTypeInfo");
        idTypeMap.put(1245185, "RpcClientAdvertAll");
        idTypeMap.put(1245186, "RpcServerAdvertInfo");
        idTypeMap.put(1245187, "RpcClientAdvertInfo");
        idTypeMap.put(1245188, "RpcClientAdvertFreeTime");
        idTypeMap.put(1245189, "RpcServerAdvertBegin");
        idTypeMap.put(1245190, "RpcServerAdvertEnd");
        idTypeMap.put(1245191, "RpcServerAdvertReward");
        idTypeMap.put(1245192, "RpcClientAdvertReward");
        idTypeMap.put(1310721, "RpcServerFighterList");
        idTypeMap.put(1310722, "RpcClientFighterList");
        idTypeMap.put(1310723, "RpcServerOneFighter");
        idTypeMap.put(1310724, "RpcClientOneFighter");
        idTypeMap.put(1310725, "RpcServerFighterLvUp");
        idTypeMap.put(1310726, "RpcClientFighterRecruitInfo");
        idTypeMap.put(1310727, "RpcServerFighterRecruit");
        idTypeMap.put(1310728, "RpcClientFighterRecruit");
        idTypeMap.put(1310729, "RpcServerFighterFirstBuy");
//        idTypeMap.put(1310730, "RpcClientFighterLike");//2024-11-21 移除
        idTypeMap.put(1310731, "RpcServerFighterLike");
        idTypeMap.put(1310732, "RpcServerFighterSkinSwitch");
        idTypeMap.put(1310733, "RpcServerFighterRecruitAdvanced");
        idTypeMap.put(1310734, "RpcClientFighterRecruitAdvancedInfo");
        idTypeMap.put(1310735, "RpcServerFighterRecruitProbInfo");
        idTypeMap.put(1310736, "RpcClientFighterRecruitProbInfo");
        idTypeMap.put(1310737, "RpcServerFighterRecruitAdvancedWish");
        idTypeMap.put(1310738, "RpcServerFighterRecruitAdvancedSelect");
        idTypeMap.put(1310739, "RpcClientFighterCritDmg");
        idTypeMap.put(1310740, "RpcClientFighterRecruitAdvancedMode");
        idTypeMap.put(1376257, "RpcServerPassportInfo");
        idTypeMap.put(1376258, "RpcClientPassportInfo");
        idTypeMap.put(1376259, "RpcServerPassportNormalReward");
        idTypeMap.put(1376260, "RpcClientPassportNormalReward");
        idTypeMap.put(1376261, "RpcServerPassportLuxuryReward");
        idTypeMap.put(1376262, "RpcClientPassportLuxuryReward");
        idTypeMap.put(1376263, "RpcClientPassportLvExp");
        idTypeMap.put(1376264, "RpcServerPassportRewardBatch");
        idTypeMap.put(1376265, "RpcClientPassportMultipleExpInfo");
        idTypeMap.put(1441793, "RpcServerFightMatch");
        idTypeMap.put(1441794, "RpcServerFightRoomCreate");
        idTypeMap.put(1441795, "RpcClientFightRoomCreate");
        idTypeMap.put(1441796, "RpcServerFightRoomDestroy");
        idTypeMap.put(1441797, "RpcClientFightRoomDestroy");
        idTypeMap.put(1441798, "RpcServerFightRoomJoin");
        idTypeMap.put(1441799, "RpcClientFightRoomMiss");
        idTypeMap.put(1441800, "RpcServerFightMatchCancel");
        idTypeMap.put(1441801, "RpcClientFightMatchCancel");
        idTypeMap.put(1441802, "RpcClientFightMatchSuccess");
        idTypeMap.put(1441803, "RpcClientFightMatchFail");
        idTypeMap.put(1441805, "RpcServerStageRewardGet");
        idTypeMap.put(1441806, "RpcClientStageInfo");
        idTypeMap.put(1441807, "RpcClientFightCoopResult");
        idTypeMap.put(1441808, "RpcClientFightPvpCircleResult");
        idTypeMap.put(1441809, "RpcClientFightCoopHardResult");
        idTypeMap.put(1441810, "RpcServerStageSwitch");
        idTypeMap.put(1441811, "RpcServerFightRoomJoinFromShare");
        idTypeMap.put(1441812, "RpcClientFightPvpPushResult");
        idTypeMap.put(1441813, "RpcClientFightRewardTimes");
        idTypeMap.put(1441814, "RpcServerFightPassRewardGet");
        idTypeMap.put(1441815, "RpcClientFightPassReward");
        idTypeMap.put(1441816, "RpcServerFightPvpWinRewardGet");
        idTypeMap.put(1441817, "RpcClientFightPvpWinReward");
        idTypeMap.put(1507329, "RpcServerRelicList");
        idTypeMap.put(1507330, "RpcClientRelicList");
        idTypeMap.put(1507331, "RpcServerOneRelic");
        idTypeMap.put(1507332, "RpcClientOneRelic");
        idTypeMap.put(1507333, "RpcServerRelicLvUp");
        idTypeMap.put(1572865, "RpcClientCardInfo");
        idTypeMap.put(1638401, "RpcServerAchieveInfo");
        idTypeMap.put(1638402, "RpcClientAchieveInfo");
        idTypeMap.put(1638403, "RpcClientOneAchieveInfo");
        idTypeMap.put(1703937, "RpcServerFriendInfo");
        idTypeMap.put(1703938, "RpcClientFriendInfo");
        idTypeMap.put(1703939, "RpcServerFriendSearchByUid");
        idTypeMap.put(1703940, "RpcServerFriendSearchByName");
        idTypeMap.put(1703941, "RpcClientFriendSearchByName");
        idTypeMap.put(1703942, "RpcServerFriendApplyAdd");
        idTypeMap.put(1703943, "RpcClientFriendApplyAdd");
        idTypeMap.put(1703944, "RpcServerFriendRefuseBeApply");
        idTypeMap.put(1703945, "RpcClientFriendRefuseBeApply");
        idTypeMap.put(1703946, "RpcServerFriendAgreeBeApply");
        idTypeMap.put(1703947, "RpcClientFriendAdd");
        idTypeMap.put(1703948, "RpcServerFriendDel");
        idTypeMap.put(1703949, "RpcClientFriendDel");
        idTypeMap.put(1703950, "RpcServerFriendFight");
        idTypeMap.put(1703951, "RpcServerFriendReadBeApplyFriends");
        idTypeMap.put(1703952, "RpcClientFriendReadBeApplyFriends");
        idTypeMap.put(1703953, "RpcServerFriendReadChat");
        idTypeMap.put(1703954, "RpcClientFriendUnreadChat");
        idTypeMap.put(1703955, "RpcClientFriendOnlineStatus");
        idTypeMap.put(1703956, "RpcServerFriendFightInvite");
        idTypeMap.put(1703957, "RpcClientFriendFightInvite");
        idTypeMap.put(1703958, "RpcClientFriendFightInviteNotice");
        idTypeMap.put(1703959, "RpcServerFriendFightInviteOp");
        idTypeMap.put(1703960, "RpcClientFriendFightInviteOp");
        idTypeMap.put(1703961, "RpcClientFriendFightInviteOpNotice");
        idTypeMap.put(1703962, "RpcServerFriendFightInviteCancel");
        idTypeMap.put(1703963, "RpcClientFriendFightInviteCancel");
        idTypeMap.put(1703964, "RpcClientFriendSearchByUid");
        idTypeMap.put(1769473, "RpcServerRankInfo");
        idTypeMap.put(1769474, "RpcClientRankInfo");
        idTypeMap.put(1835009, "RpcServerEnterChatChannel");
        idTypeMap.put(1835010, "RpcClientEnterChatChannel");
        idTypeMap.put(1835011, "RpcServerExitChatChannel");
        idTypeMap.put(1835012, "RpcClientExitChatChannel");
        idTypeMap.put(1835013, "RpcServerChatSend");
        idTypeMap.put(1835014, "RpcClientChatSend");
        idTypeMap.put(1835015, "RpcServerChatReport");
        idTypeMap.put(1835016, "RpcServerNameReport");
        idTypeMap.put(1835017, "RpcServerChatHistory");
        idTypeMap.put(1835018, "RpcClientChatHistory");
        idTypeMap.put(1835019, "RpcClientDeleteUserChat");
        idTypeMap.put(1835020, "RpcClientDeleteChat");
        idTypeMap.put(1900545, "RpcClientFirstPayGiftInfo");
        idTypeMap.put(1900546, "RpcServerFirstRechargeGiftGet");
        idTypeMap.put(1900547, "RpcClientFirstRechargeGiftAll");
        idTypeMap.put(1900548, "RpcServerSignInInfo");
        idTypeMap.put(1900549, "RpcClientSignInAll");
        idTypeMap.put(1900550, "RpcServerSignInReward");
        idTypeMap.put(1900551, "RpcClientSignInReward");
        idTypeMap.put(1900552, "RpcServerTotalSignInReward");
        idTypeMap.put(1900553, "RpcClientTotalSignInReward");
        idTypeMap.put(1900554, "RpcServerDailyFortuneRefresh");
        idTypeMap.put(1900555, "RpcClientDailyFortuneRefresh");
        idTypeMap.put(1900556, "RpcClientLimitShopDailyGift");
        idTypeMap.put(1900557, "RpcServerLimitShopDailyGiftGet");
        idTypeMap.put(1966081, "RpcServerWelfareMissionAddProgress");
        idTypeMap.put(1966082, "RpcServerWelfareSubscription");
        idTypeMap.put(1966083, "RpcServerWelfareUpdateWxGameCircleInfo");
        idTypeMap.put(2031617, "RpcClientDanInfo");
        idTypeMap.put(2031618, "RpcClientDanRewardInfo");
        idTypeMap.put(2031619, "RpcServerDanNormalReward");
        idTypeMap.put(2031620, "RpcClientDanNormalReward");
        idTypeMap.put(2031621, "RpcServerDanLuxuryReward");
        idTypeMap.put(2031622, "RpcClientDanLuxuryReward");
        idTypeMap.put(2031623, "RpcServerDanRewardBatch");
        idTypeMap.put(2097153, "RpcServerThemeActInfo");
        idTypeMap.put(2097154, "RpcClientThemeActInfo");
        idTypeMap.put(2097155, "RpcServerThemeSubActInfo");
        idTypeMap.put(2097156, "RpcClientThemeSignActInfo");
        idTypeMap.put(2097157, "RpcServerThemeSignActReward");
        idTypeMap.put(2097158, "RpcServerThemeActGift");
        idTypeMap.put(2097159, "RpcClientThemeActGift");
        idTypeMap.put(2097160, "RpcServerThemeActMission");
        idTypeMap.put(2097161, "RpcClientThemeActMission");
        idTypeMap.put(2097162, "RpcServerThemeContinuousCharge");
        idTypeMap.put(2097163, "RpcClientThemeContinuousCharge");
        idTypeMap.put(2097164, "RpcServerThemeContinuousChargeBigReward");
        idTypeMap.put(2097165, "RpcClientThemePassInfo");
        idTypeMap.put(2097166, "RpcServerThemePassInfo");
        idTypeMap.put(2097167, "RpcServerThemePassClaimReward");
        idTypeMap.put(2097168, "RpcServerThemePassUpgrade");
        idTypeMap.put(2162689, "RpcServerHeroActInfo");
        idTypeMap.put(2162690, "RpcClientHeroActInfo");
        idTypeMap.put(2162691, "RpcServerHeroSubActInfo");
        idTypeMap.put(2162692, "RpcClientHeroPassInfo");
        idTypeMap.put(2162693, "RpcServerHeroPassInfo");
        idTypeMap.put(2162694, "RpcServerHeroPassClaimReward");
        idTypeMap.put(2162696, "RpcServerHeroSignInInfo");
        idTypeMap.put(2162697, "RpcClientHeroSignInInfo");
        idTypeMap.put(2162698, "RpcServerHeroSignInReward");
        idTypeMap.put(2162699, "RpcClientHeroSignInReward");
        idTypeMap.put(2162700, "RpcServerHeroTreasureHuntInfo");
        idTypeMap.put(2162701, "RpcClientHeroTreasureHuntInfo");
        idTypeMap.put(2162702, "RpcServerHeroTreasureHuntDraw");
        idTypeMap.put(2162703, "RpcClientHeroTreasureHuntDraw");
        idTypeMap.put(2162704, "RpcServerHeroTreasureHuntLapReward");
        idTypeMap.put(65536001, "RpcClientFightPlayerList");
        idTypeMap.put(65536002, "RpcClientFightSyncSnapshot");
        idTypeMap.put(65536003, "RpcClientFightBegin");
        idTypeMap.put(65536004, "RpcClientFightEnd");
        idTypeMap.put(65536005, "RpcClientFightFrameBegin");
        idTypeMap.put(65536006, "RpcClientFightFrameEnd");
        idTypeMap.put(65536007, "RpcServerFightFighterCall");
        idTypeMap.put(65536008, "RpcClientFightFighterCall");
        idTypeMap.put(65536009, "RpcServerFightBet");
        idTypeMap.put(65536010, "RpcClientFightBetResult");
        idTypeMap.put(65536011, "RpcServerFightFighterMove");
        idTypeMap.put(65536012, "RpcClientFightFighterMove");
        idTypeMap.put(65536013, "RpcServerFightFighterSynthetic");
        idTypeMap.put(65536014, "RpcServerFightFighterSyntheticMythic");
        idTypeMap.put(65536015, "RpcServerFightFighterRemove");
        idTypeMap.put(65536016, "RpcClientFightFighterJoin");
        idTypeMap.put(65536017, "RpcClientFightFighterGrid");
        idTypeMap.put(65536018, "RpcClientFightActorAttrs");
        idTypeMap.put(65536019, "RpcClientFightSyncResource");
        idTypeMap.put(65536020, "RpcServerFightEnhance");
        idTypeMap.put(65536021, "RpcClientFightEnhance");
        idTypeMap.put(65536022, "RpcClientFightNewActors");
        idTypeMap.put(65536023, "RpcClientFightRemoveActors");
        idTypeMap.put(65536024, "RpcServerFightActorsDistance");
        idTypeMap.put(65536025, "RpcClientFightActorsDistance");
        idTypeMap.put(65536026, "RpcClientFightWaveBegin");
        idTypeMap.put(65536027, "RpcClientFightWaveEnd");
        idTypeMap.put(65536028, "RpcClientFightWaveStage");
        idTypeMap.put(65536029, "RpcServerFightWaveSelect");
        idTypeMap.put(65536030, "RpcClientFightWaveSelect");
        idTypeMap.put(65536031, "RpcClientFightWaveSelectFinish");
        idTypeMap.put(65536032, "RpcClientFightMonsterEliteAppear");
        idTypeMap.put(65536033, "RpcServerFightMonsterEliteCall");
        idTypeMap.put(65536034, "RpcClientFightMonsterEliteCall");
        idTypeMap.put(65536035, "RpcServerFightAccelerate");
        idTypeMap.put(65536036, "RpcClientFightAccelerate");
        idTypeMap.put(65536037, "RpcClientFightBuffAdd");
        idTypeMap.put(65536038, "RpcClientFightBuffRemove");
        idTypeMap.put(65536039, "RpcClientFightHitDmg");
        idTypeMap.put(65536040, "RpcClientFightCreateBullet");
        idTypeMap.put(65536041, "RpcClientFightHeal");
        idTypeMap.put(65536042, "RpcClientFightSkill");
        idTypeMap.put(65536043, "RpcServerFightMissionList");
        idTypeMap.put(65536044, "RpcClientFightMissionList");
        idTypeMap.put(65536045, "RpcClientFightMissionComplete");
        idTypeMap.put(65536046, "RpcServerFightPlayerStat");
        idTypeMap.put(65536047, "RpcClientFightPlayerStat");
        idTypeMap.put(65536048, "RpcClientFightRoomDismiss");
        idTypeMap.put(65536049, "RpcClientFightMissionUpdate");
        idTypeMap.put(65536051, "RpcServerFightFighterOperate");
        idTypeMap.put(65536052, "RpcClientFightFighterOperate");
        idTypeMap.put(65536053, "RpcServerFightFighterAttrs");
        idTypeMap.put(65536054, "RpcClientFightFighterAttrs");
        idTypeMap.put(65536055, "RpcServerFightFighterAttrsShow");
        idTypeMap.put(65536056, "RpcClientFightFighterAttrsShow");
        idTypeMap.put(65536057, "RpcServerFightNewbiePause");
        idTypeMap.put(65536058, "RpcClientFightNewbiePause");
        idTypeMap.put(65536059, "RpcServerFightNewbieResume");
        idTypeMap.put(65536060, "RpcClientFightNewbieResume");
        idTypeMap.put(65536061, "RpcServerFightNewbieGuide");
        idTypeMap.put(65536062, "RpcClientFightNewbieGuide");
        idTypeMap.put(65536063, "RpcServerFightLogin");
        idTypeMap.put(65536064, "RpcClientFightLoginFinish");
        idTypeMap.put(65536065, "RpcServerFightNewbieNextWave");
        idTypeMap.put(65536066, "RpcClientFightNewbieNextWave");
        idTypeMap.put(65536067, "RpcClientFightBuffUpdate");
        idTypeMap.put(65536068, "RpcClientFightSkillEffect");
        idTypeMap.put(65536069, "RpcClientFightPlayerOnlineStatus");
        idTypeMap.put(65536070, "RpcServerFightFighterTeleport");
        idTypeMap.put(65536071, "RpcClientFightFighterTeleport");
        idTypeMap.put(65536072, "RpcServerFightFighterTeleportAll");
        idTypeMap.put(65536073, "RpcServerFightBossHardData");
        idTypeMap.put(65536074, "RpcClientFightBossHardData");
        idTypeMap.put(65536075, "RpcClientFightErrCode");
        idTypeMap.put(65536077, "RpcClientFightFighterTreasures");

        //2024-11-3 添加15个协议
        idTypeMap.put(655399, "RpcClientUserChangeSkin");
        idTypeMap.put(655398, "RpcServerUserChangeSkin");
        idTypeMap.put(655402, "RpcClientUserSkinAdd");
        idTypeMap.put(655401, "RpcClientUserSkinList");
        idTypeMap.put(655400, "RpcServerUserSkinList");
        idTypeMap.put(1441819, "RpcServerFightMissionRewardGet");
        idTypeMap.put(2097169, "RpcServerLightLampLotteryInfo");
        idTypeMap.put(1441820, "RpcClientFightMissionInfo");
        idTypeMap.put(2097173, "RpcServerLightLampLotteryLineReward");
        idTypeMap.put(2097172, "RpcClientLightLampLottery");
        idTypeMap.put(2097175, "RpcServerLightLampLotteryColReward");
        idTypeMap.put(2097174, "RpcServerLightLampLotteryRowReward");
        idTypeMap.put(2097171, "RpcServerLightLampLottery");
        idTypeMap.put(2097170, "RpcClientLightLampLotteryInfo");
        idTypeMap.put(1441818, "RpcServerFightMissionRefresh");

        //2024-11-12 添加8个协议 移除1个协议
        idTypeMap.put(786439, "RpcServerSelectOptionalBoxReward");
        idTypeMap.put(2097177, "RpcClientGuaranteeLotteryInfo");
        idTypeMap.put(2097176, "RpcServerGuaranteeLotteryInfo");
        idTypeMap.put(2097179, "RpcClientGuaranteeLottery");
        idTypeMap.put(2097178, "RpcServerGuaranteeLottery");
        idTypeMap.put(2097180, "RpcServerGuaranteeLotteryChooseReward");
        idTypeMap.put(2097182, "RpcServerGuaranteeLotteryTimesReward");
        idTypeMap.put(2097181, "RpcClientGuaranteeLotteryItemsUpdate");
        //2024-11-21 添加5个协议 移除1个协议
        idTypeMap.put(1900561,"RpcServerContinuousCharge");
        idTypeMap.put(1900562,"RpcClientContinuousCharge");
        idTypeMap.put(1900563,"RpcServerContinuousChargeBigReward");
        idTypeMap.put(1441821,"RpcServerPeriodRewardGet");
        idTypeMap.put(1441822,"RpcClientPeriodRewardInfo");

        //2024-12-21 添加91个协议
        idTypeMap.put(2097207,"RpcServerLightLampV2RowReward");
        idTypeMap.put(2097206,"RpcServerLightLampV2LayerReward");
        idTypeMap.put(2097209,"RpcServerLightLampV2Refresh");
        idTypeMap.put(2097208,"RpcServerLightLampV2ColReward");
        idTypeMap.put(2097203,"RpcClientLightLampV2Info");
        idTypeMap.put(2097202,"RpcServerLightLampV2Info");
        idTypeMap.put(2097205,"RpcClientLightLampV2Lottery");
        idTypeMap.put(2097204,"RpcServerLightLampV2Lottery");
        idTypeMap.put(2097201,"RpcServerThemeFunHouseTimesReward");
        idTypeMap.put(2097200,"RpcClientThemeFunHouseItemsUpdate");
        idTypeMap.put(2097218,"RpcClientCandyCollectAutoExchange");
        idTypeMap.put(2097217,"RpcServerCandyCollectAutoExchange");
        idTypeMap.put(2097219,"RpcServerCandyCollectCompoundReward");
        idTypeMap.put(2097214,"RpcClientCandyCollectCollectionsReward");
        idTypeMap.put(2097213,"RpcServerCandyCollectCollectionsReward");
        idTypeMap.put(2097216,"RpcClientCandyCollectExchange");
        idTypeMap.put(2097215,"RpcServerCandyCollectExchange");
        idTypeMap.put(2097210,"RpcClientLightLampV2ItemsUpdate");
        idTypeMap.put(2097212,"RpcClientCandyCollectInfo");
        idTypeMap.put(2097211,"RpcServerCandyCollectInfo");
        idTypeMap.put(2097229,"RpcServerCandyCollectSend");
        idTypeMap.put(2097228,"RpcClientCandyCollectChangeFavorite");
        idTypeMap.put(2097225,"RpcServerCandyCollectPublish");
        idTypeMap.put(2097224,"RpcClientCandyCollectCandyUniversalItemsUpdate");
        idTypeMap.put(2097227,"RpcServerCandyCollectChangeFavorite");
        idTypeMap.put(2097226,"RpcClientCandyCollectPublish");
        idTypeMap.put(2097221,"RpcServerCandyCollectCompound");
        idTypeMap.put(2097220,"RpcClientCandyCollectCompoundReward");
        idTypeMap.put(2097223,"RpcClientCandyCollectCandyItemsUpdate");
        idTypeMap.put(2097222,"RpcClientCandyCollectCompound");
        idTypeMap.put(2097232,"RpcClientCandyCollectBoardInfo");
        idTypeMap.put(2097231,"RpcServerCandyCollectBoardInfo");
        idTypeMap.put(2097234,"RpcServerCandyCollectInfoRead");
        idTypeMap.put(2097233,"RpcClientCandyBoardUpdate");
        idTypeMap.put(2097230,"RpcClientCandyCollectSend");
        idTypeMap.put(65536076,"RpcClientFightCardData");
        idTypeMap.put(65536078,"RpcServerFightWaveSelectRefresh");
        idTypeMap.put(65536079,"RpcClientFightWaveSelectRefresh");
        idTypeMap.put(65536080,"RpcClientFightBetData");
        idTypeMap.put(65536083,"RpcClientFightExitSpectate");
        idTypeMap.put(65536084,"RpcClientFightBonds");
        idTypeMap.put(65536081,"RpcServerFightGiveUp");
        idTypeMap.put(65536082,"RpcServerFightExitSpectate");
        idTypeMap.put(65536085,"RpcServerFightPlayerResources");
        idTypeMap.put(65536086,"RpcClientFightPlayerResources");
        idTypeMap.put(1114123,"RpcClientBroadcastShopBuy");
        idTypeMap.put(2097188,"RpcServerTreasureHuntChooseReward");
        idTypeMap.put(2097187,"RpcClientTreasureHuntInfo");
        idTypeMap.put(2097189,"RpcClientTreasureHuntChooseReward");
        idTypeMap.put(2097184,"RpcClientThemeSignFundInfo");
        idTypeMap.put(2097183,"RpcServerThemeSignFundInfo");
        idTypeMap.put(2097186,"RpcServerTreasureHuntInfo");
        idTypeMap.put(2097185,"RpcServerThemeSignFundClaimReward");
        idTypeMap.put(2097199,"RpcClientThemeFunHouseDraw");
        idTypeMap.put(2097198,"RpcServerThemeFunHouseDraw");
        idTypeMap.put(2097195,"RpcClientThemeAccumulateChargeInfo");
        idTypeMap.put(2097194,"RpcServerThemeAccumulateChargeClaimReward");
        idTypeMap.put(2097197,"RpcClientThemeFunHouseInfo");
        idTypeMap.put(2097196,"RpcServerThemeFunHouseInfo");
        idTypeMap.put(2097191,"RpcServerTreasureHuntLottery");
        idTypeMap.put(2097190,"RpcClientTreasureHuntItemsUpdate");
        idTypeMap.put(2097193,"RpcServerThemeAccumulateChargeInfo");
        idTypeMap.put(2097192,"RpcClientTreasureHuntLottery");
        idTypeMap.put(851971,"RpcServerRedDiamondPayCreateOrder");
        idTypeMap.put(2162719,"RpcClientHeroGuaranteeLotteryItemsUpdate");
        idTypeMap.put(2162716,"RpcServerHeroGuaranteeLottery");
        idTypeMap.put(2162715,"RpcClientHeroGuaranteeLotteryInfo");
        idTypeMap.put(2162718,"RpcServerHeroGuaranteeLotteryChooseReward");
        idTypeMap.put(2162717,"RpcClientHeroGuaranteeLottery");
        idTypeMap.put(2162720,"RpcServerHeroGuaranteeLotteryTimesReward");
        idTypeMap.put(2228225,"RpcServerRoyalRoadMissionComplete");
        idTypeMap.put(2228226,"RpcServerRoyalRoadClaimLevelReward");
        idTypeMap.put(2228227,"RpcClientRoyalRoadLevelReward");
        idTypeMap.put(2228228,"RpcClientRoyalRoadInfo");
        idTypeMap.put(2228229,"RpcServerRoyalRoadTrainStart");
        idTypeMap.put(2162708,"RpcClientBlindBoxLottery");
        idTypeMap.put(2162705,"RpcServerBlindBoxInfo");
        idTypeMap.put(2162707,"RpcServerBlindBoxLottery");
        idTypeMap.put(2162706,"RpcClientBlindBoxInfo");
        idTypeMap.put(2162712,"RpcServerHeroActMission");
        idTypeMap.put(2162711,"RpcServerBlindBoxTimesReward");
        idTypeMap.put(2162714,"RpcServerHeroGuaranteeLotteryInfo");
        idTypeMap.put(2162713,"RpcClientHeroActMission");
        idTypeMap.put(2162710,"RpcClientBlindBoxItemsUpdate");
        idTypeMap.put(2228230,"RpcClientRoyalRoadTrainStart");
        idTypeMap.put(655403,"RpcServerUserSettings");
        idTypeMap.put(655404,"RpcClientUserSettings");
        idTypeMap.put(1441823,"RpcClientFightCoopNightmareResult");
        idTypeMap.put(1441825,"RpcClientWorldBossInfo");
        idTypeMap.put(1441824,"RpcServerFightEnterSpectate");
        idTypeMap.put(1441826,"RpcClientFightWorldBossResult");
        //局内聊天协议
        idTypeMap.put(65536087,"RpcClientFightChatSend");

        //2025-01-18 添加15个协议
        idTypeMap.put(2359300,"RpcServerInviteList");
        idTypeMap.put(2359301,"RpcClientInviteList");
        idTypeMap.put(2359302,"RpcClientInviteInfo");
        idTypeMap.put(2359303,"RpcServerInviteShare");
        idTypeMap.put(1900564,"RpcClientTwistEggsInfo");
        idTypeMap.put(1900565,"RpcServerTwistEggsLottery");
        idTypeMap.put(1900566,"RpcClientTwistEggsLottery");
        idTypeMap.put(1900567,"RpcClientTwistEggsItemsUpdate");
        idTypeMap.put(2359298,"RpcServerInviteBind");
        idTypeMap.put(2359299,"RpcClientInviteBind");
        idTypeMap.put(655405,"RpcServerBcLog");
        idTypeMap.put(1441827,"RpcClientFightTowerClimbResult");
        idTypeMap.put(1441838,"RpcServerMiniGameGetReward");
        idTypeMap.put(1441837,"RpcServerMiniGamePass");
        idTypeMap.put(1441839,"RpcClientMiniGameInfo");

        //2025-01-23 添加65个协议
        idTypeMap.put(65536088,"RpcClientFightUpdateActorPos");
        idTypeMap.put(65536089,"RpcClientFightUpdateActorExtraParams");
        idTypeMap.put(1900600,"RpcServerCardCollectItemExchange");
        idTypeMap.put(1900601,"RpcClientCardCollectItemExchange");
        idTypeMap.put(1900627,"RpcServerTreasureInfo");
        idTypeMap.put(1900628,"RpcClientTreasureInfo");
        idTypeMap.put(1900629,"RpcServerTreasureAccumulateBuyGiftReward");
        idTypeMap.put(1900635,"RpcServerBigWheelDraw");
        idTypeMap.put(1900636,"RpcClientBigWheelDraw");
        idTypeMap.put(1900637,"RpcServerFestivalLotteryInfo");
        idTypeMap.put(1900638,"RpcClientFestivalLotteryInfo");
        idTypeMap.put(1900639,"RpcServerFestivalLotteryDraw");
        idTypeMap.put(1900630,"RpcClientTreasureAccumulateBuyGiftReward");
        idTypeMap.put(1900631,"RpcServerTreasureExchangeReward");
        idTypeMap.put(1900632,"RpcClientTreasureExchangeReward");
        idTypeMap.put(1900633,"RpcServerBigWheelInfo");
        idTypeMap.put(1900634,"RpcClientBigWheelInfo");
        idTypeMap.put(1900640,"RpcClientFestivalLotteryDraw");
        idTypeMap.put(1900641,"RpcClientFestivalLotteryNoticeAll");
        idTypeMap.put(1900642,"RpcClientFestivalLotteryNoticeAdd");
        idTypeMap.put(2490370,"RpcClientLiveInfo");
        idTypeMap.put(2490369,"RpcServerLiveInfo");
        idTypeMap.put(1900569,"RpcServerSignInFundRewardGet");
        idTypeMap.put(2424837,"RpcServerLionDancePlayUploadScore");
        idTypeMap.put(2424838,"RpcServerLionDancePlayRewardGet");
        idTypeMap.put(2424833,"RpcClientMazePlayInfo");
        idTypeMap.put(2424834,"RpcServerMazePlayUploadScore");
        idTypeMap.put(2424835,"RpcServerMazePlayRewardGet");
        idTypeMap.put(2424836,"RpcClientLionDancePlayInfo");
        idTypeMap.put(1900568,"RpcClientSignInFundInfo");
        idTypeMap.put(1900570,"RpcServerSignInFundResign");
        idTypeMap.put(1900571,"RpcClientActInfo");
        idTypeMap.put(1900572,"RpcServerDmgLotteryInfo");
        idTypeMap.put(1900573,"RpcClientDmgLotteryInfo");
        idTypeMap.put(1900574,"RpcServerDmgLotteryAttack");
        idTypeMap.put(1900575,"RpcClientDmgLotteryAttack");
        idTypeMap.put(1900576,"RpcServerDmgLotteryReward");
        idTypeMap.put(1900577,"RpcClientDmgLotteryReward");
        idTypeMap.put(1900578,"RpcClientDmgLotteryItemNotice");
        idTypeMap.put(1900579,"RpcServerDmgLotteryItemExchange");
        idTypeMap.put(1900580,"RpcClientDmgLotteryItemExchange");
        idTypeMap.put(1900581,"RpcServerCardCollectInfo");
        idTypeMap.put(1900582,"RpcClientCardCollectInfo");
        idTypeMap.put(1900583,"RpcServerCardCollectLottery");
        idTypeMap.put(1900584,"RpcClientCardCollectLottery");
        idTypeMap.put(1900585,"RpcServerCardCollectConsume");
        idTypeMap.put(1900586,"RpcClientCardCollectConsume");
        idTypeMap.put(1900587,"RpcClientCardCollectCardItemsUpdate");
        idTypeMap.put(1900588,"RpcClientCardCollectCardBagUpdate");
        idTypeMap.put(1900589,"RpcServerCardCollectPublish");
        idTypeMap.put(1900590,"RpcClientCardCollectPublish");
        idTypeMap.put(1900591,"RpcServerCardCollectChangeFavorite");
        idTypeMap.put(1900592,"RpcClientCardCollectChangeFavorite");
        idTypeMap.put(1900593,"RpcServerCardCollectSend");
        idTypeMap.put(1900594,"RpcClientCardCollectSend");
        idTypeMap.put(1900595,"RpcServerCardCollectBoardInfo");
        idTypeMap.put(1900596,"RpcClientCardCollectBoardInfo");
        idTypeMap.put(1900597,"RpcServerCardCollectLogInfo");
        idTypeMap.put(1900598,"RpcClientCardCollectLogInfo");
        idTypeMap.put(1900599,"RpcServerCardCollectInfoRead");
        idTypeMap.put(655407,"RpcServerUserEnterAnimationList");
        idTypeMap.put(655406,"RpcClientUserChangeEnterAnimation");
        idTypeMap.put(655409,"RpcClientUserEnterAnimationAdd");
        idTypeMap.put(655408,"RpcClientUserEnterAnimationList");
        idTypeMap.put(655410,"RpcServerBcLog");

        //反向也注册一下
        idTypeMap.forEach((k, v)->{
            typeIdMap.put(v, k);
        });
    }

    public static String getTypeById(int id) {
        return idTypeMap.getOrDefault(id, "未知协议" + id);
    }

    public static int getIdByType(String type) {
        return typeIdMap.getOrDefault(type, 0);
    }


    public static String replaceTlp = "package proto;\n" +
            "\n" +
            "option java_multiple_files = false;\n" +
            "option java_package = \"cn.bigfire.wzdj.pojo.srcVo\";\n" +
            "option java_outer_classname = \"wzdj\";\n" +
            "\n";
    @Test
    @SneakyThrows
    public void updateProtoFile() {
        //http->protoFile
        String protocolUrl = "https://wzdj.hnys68.cn:20002/get_rpc_cfg?_v=7edba38366ce905f128a00668f5bf763&code=plain";
        log.info(protocolUrl);
        String result = HttpUtil.get(protocolUrl);
        String cutKey = "syntax";
        String json = StrUtil.subBefore(result, cutKey, Boolean.TRUE);

        if (!JSONUtil.isTypeJSONObject(json)) {
            log.error("json解析失败");
            return;
        }
        JSONObject jsonObject = JSON.parseObject(json);
        List<String> localKeys = idTypeMap.keySet().stream().map(integer -> integer + "").collect(Collectors.toList());
        List<String> remoteKeys = new ArrayList<>(jsonObject.keySet());
        Collection<String> disjunction = CollUtil.disjunction(localKeys, remoteKeys);
        if (CollUtil.isEmpty(disjunction)) {
            log.info("无数据变动");
           return;
        }
        int addNum = 0;
        int removeNum = 0;
        for (String key : disjunction) {
            if (localKeys.contains(key)) {
                log.info("移除:" + key + "," + idTypeMap.get(Integer.parseInt(key)));
                removeNum++;
            } else {
//                log.info("新增:" + key + "," + jsonObject.get(key));
                System.out.printf("idTypeMap.put(%s,\"%s\");%n", key, jsonObject.get(key));
                addNum++;
            }
        }
        log.info("新增:" + addNum + ",移除:" + removeNum);


        String protobuf = cutKey + StrUtil.subAfter(result, cutKey, Boolean.TRUE);
        String replace = protobuf.replace("package proto;", replaceTlp);

        //生成到data目录下，然后复制Wzdj部分覆盖代码里的代码 注意data目录在当前项目下，不是根目录下
//        JProtoc.genJavaBeanByProtoStrLombok(replace, new File("data\\local\\"));

        //直接生成到项目目录下
        JProtoc.genJavaBeanByProtoStrLombok(replace, new File("src\\main\\java\\cn\\bigfire\\wzdj\\pojo\\srcVo\\"));
    }



    public static String printTlp = "public static void cmd%s_%s(Channel channel,WZDJPack wzdjPack\n,%s %s) {\n" +
            "       log.info(DateUtil.format(new Date(), \"yyyy-MM-dd HH:mm:ss.SSS\") + wzdjPack.toString());\n" +
            "    }";




    @Test
    @SneakyThrows
    public void testShowReceiveCode() {
        HashMap<Integer, String> idTypeMap = new HashMap<>();
//        idTypeMap.put(65536087,"RpcClientFightChatSend");

        //2025-01-23 添加65个协议
        idTypeMap.put(65536088,"RpcClientFightUpdateActorPos");
        idTypeMap.put(65536089,"RpcClientFightUpdateActorExtraParams");
        idTypeMap.put(1900600,"RpcServerCardCollectItemExchange");
        idTypeMap.put(1900601,"RpcClientCardCollectItemExchange");
        idTypeMap.put(1900627,"RpcServerTreasureInfo");
        idTypeMap.put(1900628,"RpcClientTreasureInfo");
        idTypeMap.put(1900629,"RpcServerTreasureAccumulateBuyGiftReward");
        idTypeMap.put(1900635,"RpcServerBigWheelDraw");
        idTypeMap.put(1900636,"RpcClientBigWheelDraw");
        idTypeMap.put(1900637,"RpcServerFestivalLotteryInfo");
        idTypeMap.put(1900638,"RpcClientFestivalLotteryInfo");
        idTypeMap.put(1900639,"RpcServerFestivalLotteryDraw");
        idTypeMap.put(1900630,"RpcClientTreasureAccumulateBuyGiftReward");
        idTypeMap.put(1900631,"RpcServerTreasureExchangeReward");
        idTypeMap.put(1900632,"RpcClientTreasureExchangeReward");
        idTypeMap.put(1900633,"RpcServerBigWheelInfo");
        idTypeMap.put(1900634,"RpcClientBigWheelInfo");
        idTypeMap.put(1900640,"RpcClientFestivalLotteryDraw");
        idTypeMap.put(1900641,"RpcClientFestivalLotteryNoticeAll");
        idTypeMap.put(1900642,"RpcClientFestivalLotteryNoticeAdd");
        idTypeMap.put(2490370,"RpcClientLiveInfo");
        idTypeMap.put(2490369,"RpcServerLiveInfo");
        idTypeMap.put(1900569,"RpcServerSignInFundRewardGet");
        idTypeMap.put(2424837,"RpcServerLionDancePlayUploadScore");
        idTypeMap.put(2424838,"RpcServerLionDancePlayRewardGet");
        idTypeMap.put(2424833,"RpcClientMazePlayInfo");
        idTypeMap.put(2424834,"RpcServerMazePlayUploadScore");
        idTypeMap.put(2424835,"RpcServerMazePlayRewardGet");
        idTypeMap.put(2424836,"RpcClientLionDancePlayInfo");
        idTypeMap.put(1900568,"RpcClientSignInFundInfo");
        idTypeMap.put(1900570,"RpcServerSignInFundResign");
        idTypeMap.put(1900571,"RpcClientActInfo");
        idTypeMap.put(1900572,"RpcServerDmgLotteryInfo");
        idTypeMap.put(1900573,"RpcClientDmgLotteryInfo");
        idTypeMap.put(1900574,"RpcServerDmgLotteryAttack");
        idTypeMap.put(1900575,"RpcClientDmgLotteryAttack");
        idTypeMap.put(1900576,"RpcServerDmgLotteryReward");
        idTypeMap.put(1900577,"RpcClientDmgLotteryReward");
        idTypeMap.put(1900578,"RpcClientDmgLotteryItemNotice");
        idTypeMap.put(1900579,"RpcServerDmgLotteryItemExchange");
        idTypeMap.put(1900580,"RpcClientDmgLotteryItemExchange");
        idTypeMap.put(1900581,"RpcServerCardCollectInfo");
        idTypeMap.put(1900582,"RpcClientCardCollectInfo");
        idTypeMap.put(1900583,"RpcServerCardCollectLottery");
        idTypeMap.put(1900584,"RpcClientCardCollectLottery");
        idTypeMap.put(1900585,"RpcServerCardCollectConsume");
        idTypeMap.put(1900586,"RpcClientCardCollectConsume");
        idTypeMap.put(1900587,"RpcClientCardCollectCardItemsUpdate");
        idTypeMap.put(1900588,"RpcClientCardCollectCardBagUpdate");
        idTypeMap.put(1900589,"RpcServerCardCollectPublish");
        idTypeMap.put(1900590,"RpcClientCardCollectPublish");
        idTypeMap.put(1900591,"RpcServerCardCollectChangeFavorite");
        idTypeMap.put(1900592,"RpcClientCardCollectChangeFavorite");
        idTypeMap.put(1900593,"RpcServerCardCollectSend");
        idTypeMap.put(1900594,"RpcClientCardCollectSend");
        idTypeMap.put(1900595,"RpcServerCardCollectBoardInfo");
        idTypeMap.put(1900596,"RpcClientCardCollectBoardInfo");
        idTypeMap.put(1900597,"RpcServerCardCollectLogInfo");
        idTypeMap.put(1900598,"RpcClientCardCollectLogInfo");
        idTypeMap.put(1900599,"RpcServerCardCollectInfoRead");
        idTypeMap.put(655407,"RpcServerUserEnterAnimationList");
        idTypeMap.put(655406,"RpcClientUserChangeEnterAnimation");
        idTypeMap.put(655409,"RpcClientUserEnterAnimationAdd");
        idTypeMap.put(655408,"RpcClientUserEnterAnimationList");
        idTypeMap.put(655410,"RpcServerBcLog");

        idTypeMap.forEach((id, type) -> {
            String lowerFirst = StrUtil.lowerFirst(type);
            System.out.println(String.format(printTlp, id, type, type, lowerFirst));
        });
    }

    @Test
    @SneakyThrows
    public void call() {
        updateProtoFile();
    }

}


/**
 * 更新流程
 * 1运行 call 方法。
 * 2.同时把新增的协议号。添加到idMap里。
 * 3.然后再 把新增的协议号放在  testShowReceiveCode方法中运行
 * 4.把新增的协议号接收代码贴近caller里就行了
 */
